/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ajustes;

import ajustes.db.Conexion;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Jessica Ordoñez
 */
public class Main {

    public static Conexion conn;



    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
            
        
        try {
            // TODO code application logic here
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            
            try {
                for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (Exception e) {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            }

            
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
        FrameLogin login = new FrameLogin(Main.conn);
        login.setVisible(true);
        

        //JFAjustes.main(args);


    }

    static {
        try {
            Main.conn = new Conexion("localhost", "2638", "local");
            Main.conn.connect();
        } catch (SQLException ex) {
            //Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "Base de datos no disponible", "Conexion - Apertura de Ajuste 1.0", JOptionPane.ERROR_MESSAGE);
            //System.exit(1);
        }
    }
}
